package InPutStreamReader;

import java.io.*;

public class InPutStreamReaderDemo {
    public static void main(String[] args) throws IOException {
        InputStreamReader isr=new InputStreamReader(new FileInputStream("demo\\src\\fos.java"));
        OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream("demo\\copy.java"));

     /*   int ch; 一次读一个字符
        while ((ch= isr.read())!=-1){
            System.out.print((char)ch);
        }
      */



        char[] chs=new char[1024];//一次读一个字符组数据
        int len;
        while((len=isr.read(chs))!=-1){
            System.out.print(new String(chs,0,len));
        }
        osw.close();
isr.close();
    }
}
